<?php
class ScrollVerticalWidget extends CWidget
{
	public $title = '';
	private $_url = NULL;
	public function init()
	{
		$dir = dirname(__FILE__).DIRECTORY_SEPARATOR.'assets';
		$this->_url = Yii::app()->getAssetManager()->publish($dir);
		$cs = Yii::app()->getClientScript();
		$cs->registerCssFile("{$this->_url}/css/style.css");
		$cs->registerCoreScript('jquery');
		$cs->registerScriptFile("{$this->_url}/js/jcarousellite_1.0.1c4.js");
		$cs->registerScript(
				'scroller-vertical',
				"$(\".newsticker-jcarousellite\").jCarouselLite({
					vertical: true,
					hoverPause:true,
					visible: 0,
					auto:500,
					speed:1000
				});",
				CClientScript::POS_READY
		);
		parent::init();
	}
	public function run()
	{
		$this->render('default', array(
				'url'=>$this->_url
		));
	}
}